<style tyle="text/css">
    .modal-lg {
        width: 60%;
    }
    .freestyle {
      margin-bottom: 3px;
      margin-right: 5px;
      float: left;
    }
</style>
<div class="modal-body">
  <tabset class="tab-container" style="margin-bottom: 0px">
    <tab heading="基本信息">
      <form name="form" class="form-horizontal ng-pristine ng-valid-required">
        <div class="form-group">
          <label class="col-lg-3 control-label">标题:</label>
          <div class="col-lg-6">
            <input type="text" class="form-control" ng-model="policyInfo.title">
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-3 control-label">补贴总额度:</label>
          <div class="col-lg-6">
            <div class="input-group">
              <input type="number" class="form-control" placeholder="0" ng-model="policyInfo.subsidy_total">
              <span class="input-group-addon">元</span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-3 control-label">旅行社最高额度:</label>
          <div class="col-lg-6">
            <div class="input-group">
              <input type="number" class="form-control" placeholder="0" ng-model="policyInfo.subsidy_limit">
              <span class="input-group-addon">元</span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-lg-3 control-label">政策及法规内容:</label>
          <div class="col-lg-7">
            <textarea class="form-control" rows="10" ng-model="policyInfo.context"></textarea>
          </div>
        </div>
      </form>
    </tab>

    <tab heading="补贴范围" ng-click="seeSubsidyRange(true)">
      <form name="form" class="form-horizontal ng-pristine ng-valid-required">
        <div class="form-group">
          <div class="btn-group col-lg-8 col-lg-offset-2">
            <label class="btn btn-md btn-info col-lg-4" ng-model="obj.type" btn-radio="'0'" ng-click="setType()">
              <i class="fa fa-check text-active"></i> 不限制
            </label>
            <label class="btn btn-md btn-info col-lg-4" ng-model="obj.type" btn-radio="'1'" ng-click="setType()">
              <i class="fa fa-check text-active"></i> 按身份证号
            </label>
            <label class="btn btn-md btn-info col-lg-4" ng-model="obj.type" btn-radio="'2'" ng-click="setType()">
              <i class="fa fa-check text-active"></i> 按身份证地址
            </label>
          </div>
        </div>
        <div ng-show="obj.type != 0">
          <div class="form-group">
            <label class="col-lg-3 control-label">限制方式:</label>
            <div class="col-lg-6">
              <div class="radio">
                <label class="i-checks">
                  <input type="radio" name="contain" ng-model="obj.contain" value="1"><i></i> 包含
                </label>
                <label class="i-checks" style="margin-left: 20px">
                  <input type="radio" name="contain" ng-model="obj.contain" value="0"><i></i> 不包含
                </label>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-lg-3 control-label">{{obj.type == 1?'身份证前缀':'地址名称'}}:</label>
            <div class="col-lg-5">
              <input type="text" class="form-control" ng-model="obj.context" 
               placeholder="{{obj.type == 1?'2101...':'辽宁省沈阳市...'}}">
            </div>
            <div class="col-lg-2">
              <button class="btn btn-success" type="button" ng-click="addSubsidyRange()">添加</button>
            </div>
          </div>
          <div class="form-group">
            <label class="col-lg-3 control-label">已添加(包含):</label>
            <div class="col-lg-8">
              <div class="freestyle" ng-repeat="info in rangeList | filter: {'contain': 1}">
                <button class="btn btn-sm btn-info">{{info.context}}
                  <i class="glyphicon glyphicon-remove" ng-click="removeRange(info.id)"></i>
                </button>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-lg-3 control-label">已添加(不包含):</label>
            <div class="col-lg-8">
              <div class="freestyle" ng-repeat="info in rangeList | filter: {'contain': 0}">
                <button class="btn btn-sm btn-info">{{info.context}}
                  <i class="glyphicon glyphicon-remove" ng-click="removeRange(info.id)"></i>
                </button>
              </div>
            </div>
          </div>
          <div class="form-group">
            <i class="col-lg-8 col-lg-offset-2" style="color: red">* 温馨提示 : 若已添加对应栏无信息，则视为无对应限制</i>
          </div>
        </div>
      </form>
    </tab>
    
    <tab heading="补贴标准" ng-click="seeStandard(true)">
      <div class="wapper">
        <div class="col-lg-12">
          <div class="col-lg-4">
            <ui-select ng-model="obj.subsidy_type" theme="bootstrap">
              <ui-select-match placeholder="选择补贴类型.">{{$select.selected.name}}</ui-select-match>
              <ui-select-choices repeat="info in obj.subsidyTypeList | filter: {'name':$select.search}">
                  <span ng-bind-html="info.name"></span>
              </ui-select-choices>
            </ui-select>
          </div>
          <div class="col-lg-4">
            <div class="input-group">
              <input type="number" class="form-control" placeholder="补贴金额" ng-model="standard.subsidy_money">
              <span class="input-group-addon">元 / 人</span>
            </div>
          </div>
          <div class="col-lg-4">
            <ui-select ng-model="standard.tourist_type" theme="bootstrap">
              <ui-select-match placeholder="选择游客类型.">{{$select.selected.label}}</ui-select-match>
              <ui-select-choices repeat="info.value as info in obj.touristTypeList">
                  <span ng-bind-html="info.label"></span>
              </ui-select-choices>
            </ui-select>
          </div>
        </div>
        <div class="col-lg-12" style="margin-top: 10px">
          <div class="col-lg-4">
            <div class="input-group">
              <input type="number" class="form-control" placeholder="人数下限" ng-model="standard.lower_limit_person">
              <span class="input-group-addon">人</span>
            </div>
          </div>
          <div class="col-lg-4">
            <div class="input-group">
              <input type="number" class="form-control" placeholder="人数上限" ng-model="standard.upper_limit_person">
              <span class="input-group-addon">人</span>
            </div>
          </div>
          <div class="col-lg-2 pull-right">
            <button class="btn m-b-xs w-xs btn-success" ng-click="addStandard(obj.subsidy_type)">添加标准</button>
          </div>
        </div>
      </div>

      <table class="table table-striped table-bordered dataTable">
        <thead>
          <tr>
            <th class="col-md-2 text-center">补贴类型</th>
            <th class="col-md-2 text-center">游客类型</th>
            <th class="col-md-3 text-center">人数范围</th>
            <th class="col-md-2 text-center">金额(元)</th>
            <th class="col-md-2"></th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="info in standardList">
            <td class="text-center">{{info.subsidy_type_name}}</td>
            <td class="text-center">{{info.tourist_type==1?'国内游客':'国外游客'}}</td>
            <td class="text-center">{{info.lower_limit_person}}
              <span ng-show="info.upper_limit_person"> ~ {{info.upper_limit_person}}(包含)</span>
              <span ng-show="!info.upper_limit_person">以上</span>
            </td>
            <td class="text-center">{{info.subsidy_money}}</td>
            <td class="text-center">
              <button type="button" class="btn btn-danger btn-xs" ng-click="deleteStandard($index)">删除</button>
            </td>
          </tr>
        </tbody>
      </table>
    </tab>

  </tabset>
</div>
<div class="modal-footer">
  <label class="col-lg-4 text-left" ng-show="policyInfo.update_time">上次修改时间:{{policyInfo.update_time}}</label>
  <button class="btn btn-success" type="button" ng-click="ok()">保存</button>
  <button class="btn btn-danger" type="button" ng-click="close()">关闭</button>
</div>